//
//  ComTableViewCell.m
//  CarFace
//
//  Created by dlios on 15-3-28.
//  Copyright (c) 2015年 蓝鸥科技. All rights reserved.
//

#import "ComTableViewCell.h"

@implementation ComTableViewCell

- (void)dealloc
{
    [_lableDate release];
    [_lableName release];
    [_lableTitle release];
    [super dealloc];

}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

        self.lableDate = [[UILabel alloc]init];
        self.lableDate.font = [UIFont systemFontOfSize:14.0f];
        [self.contentView addSubview:self.lableDate];
        [_lableDate release];
        
        self.lableName = [[UILabel alloc]init];
        self.lableName.font = [UIFont systemFontOfSize:14.0f];
        self.lableName.textAlignment = NSTextAlignmentRight;
        [self.contentView addSubview:self.lableName];
        [_lableName release];
        
        self.lableTitle = [[UILabel alloc]init];
        self.lableTitle.font = [UIFont systemFontOfSize:17.0f];
        self.lableTitle.numberOfLines = 0;
        
        [self.contentView addSubview:self.lableTitle];
        [_lableTitle release];
        
        
        
    
    }

    return self;


}

- (void)layoutSubviews
{
    [super layoutSubviews];
    CGFloat width = self.contentView.bounds.size.width;
    CGFloat height = self.contentView.bounds.size.height;
  
    self.lableTitle.frame = CGRectMake(7, 5, width - 10, height / 2);
    self.lableDate.frame = CGRectMake(7, height / 2 + 10, width / 3, height / 3 - 7);
    
    self.lableName.frame = CGRectMake(width / 3, height / 2 + 10, width * 2 / 3 - 15, height / 3);

    
    self.lableTitle.text = self.foru.title;
    
    NSString *string0 = self.foru.lastreplydate;
    NSString *str = @"回复:";
    self.lableDate.text = [str stringByAppendingString:string0];
    
    NSString *string = [NSString stringWithFormat:@"%@", self.foru.replycounts];
    NSString *string2 = [string stringByAppendingString:@"回"];
    NSString *string1 = [self.foru.postusername stringByAppendingString:@" "];
    self.lableName.text = [string1 stringByAppendingString:string2];



}








- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
